package com.cskaoyan.controller;

import com.cskaoyan.service.goods.GoodsService;
import com.cskaoyan.service.home.HomeIndexService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.home.WxHomeIndexVo;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:微信小程序的homeindex模块,主要功能：
 *
 * wx/home/index 首页信息
 *
 * author:houzhitao@139.com
 */
@RestController
public class WxHomeIndexController {

    private ObjectMapper objectMapper =new ObjectMapper();
    {
        objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
    }
    @Autowired
    HomeIndexService homeIndexService;

    @RequestMapping("wx/home/index")
    public BaseRespVo homeIndex(){
        WxHomeIndexVo wxHomeIndexVo = homeIndexService.homeIndex();
        return BaseRespVo.ok(wxHomeIndexVo);
    }
}
